<?php

namespace app\shop\model\user;

use app\shop\library\ShopAuth;
use app\shop\model\BaseModel;

class UserAddressModel extends BaseModel
{
    protected $name = 'shop_user_address';

    /**
     * 查询范围：用户ID
     * @param $query
     * @return void
     * @noinspection PhpMissingReturnTypeInspection
     */
    public function scopeUserId($query)
    {
        $query->where([
            ['user_id', '=', ShopAuth::instance()->id],
        ]);
    }
}
